

import request from '@/router/axios'

export function fetchList(query) {
  return request({
    url: '/subwayst/swStOutputDetail/page',
    method: 'get',
    params: query
  })
}

export function addObj(obj) {
  return request({
    url: '/subwayst/swStOutputDetail/',
    method: 'post',
    data: obj
  })
}

export function getObj(id) {
  return request({
    url: '/subwayst/swStOutputDetail/' + id,
    method: 'get'
  })
}

export function delObj(row) {
  return request({
    url: '/subwayst/swStOutputDetail/' + row.id,
    method: 'delete'
  })
}

export function putObj(obj) {
  return request({
    url: '/subwayst/swStOutputDetail/',
    method: 'put',
    data: obj
  })
}
//批量出库操作
export function putBatchObj(obj) {
  return request({
    url: '/subwayst/swStOutputDetail/putBatchObj',
    method: 'put',
    data: obj
  })
}

//批量删除库区为空的数据
export function delBatch(ids) {
  return request({
    url: '/subwayst/swStOutputDetail/delBatch',
    method: 'delete',
    data:ids
  })
}

export function exportExcel(query){
  return request({
    url: '/subwayst/swStOutputDetail/export',
    method: 'get',
    responseType:'blob',
    params: query
  })
}

export function exportByIds(query){
  return request({
    url: '/subwayst/swStOutputDetail/exportByIds',
    method: 'post',
    data: query,
    responseType: 'blob',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
  })
}

export function inventoryOutType() {
  return request({
    url: '/admin/dict/type/inventory_out_type',
    method: 'get'
  })

}

export function exportAll(query){
  return request({
    url: '/subwayst/swStOutputDetail/exportAll',
    method: 'post',
    data: query,
    responseType: 'blob',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
  })
}

export function applyed(ids) {
  return request({
    url: '/subwayst/swStOutputDetail/applyed',
    method: 'put',
    data: ids
  })
}

export function approved(ids) {
  return request({
    url: '/subwayst/swStOutputDetail/approved',
    method: 'put',
    data: ids
  })
}